package com.kuaixueit.crm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kuaixueit.crm.mapper.CDeptMapper;
import com.kuaixueit.crm.pojo.CDept;
import com.kuaixueit.crm.service.DeptService;

@Service
public class DeptServiceImpl implements DeptService {
  
  
  @Autowired
  private CDeptMapper deptMapper;

  @Override
  public CDept getDeptById(Integer id) {
    return deptMapper.selectByPrimaryKey(id);
  }

  @Override
  public PageInfo getPageList(Integer pageNum, Integer pageSize) {
    //使用分页插件
    PageHelper.startPage(pageNum, pageSize);
    List<CDept> list = deptMapper.getList();
    PageInfo info = new PageInfo(list);
    return info;
  }

}
